package com.qfjg.service.imp;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qfjg.entity.DumpRecord;
import com.qfjg.entity.DumpRecordQueryInfo;
import com.qfjg.mappers.DumpRecordMapper;
import com.qfjg.service.DumpRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DumpRecordImp extends ServiceImpl<DumpRecordMapper, DumpRecord> implements DumpRecordService {

    @Autowired
    DumpRecordMapper dumpRecordMapper;

    @Override
    public void insert(DumpRecord dumpRecord) {
        dumpRecordMapper.insert(dumpRecord);
    }

    @Override
    public boolean updateById(DumpRecord dumpRecord) {
        return dumpRecordMapper.updateById(dumpRecord) > 0;
    }

    @Override
    public boolean deleteById(String dumpId) {
        return dumpRecordMapper.deleteById(dumpId) > 0;
    }

    @Override
    public List<DumpRecord> selectDumpRecordList(String projectId) {

        return dumpRecordMapper.getByProjectId(projectId);
    }

    @Override
    public List<DumpRecord> selectDumpRecordListByQuery(DumpRecordQueryInfo dumpRecordQueryInfo) {

        List<DumpRecord> dumpRecords = dumpRecordMapper.selectDumpRecordListByQuery(dumpRecordQueryInfo);
        return dumpRecords;
    }
}
